/*
Date:20210529 22:43PM
key:小于3就返回0
*/
class Solution {
public:
    bool check(string&s,int i)
    {
        return ((s[i]^s[i+1])&&(s[i]^s[i+2])&&(s[i+2]^s[i+1]));
    }
    int countGoodSubstrings(string s) 
    {
        if(s.size()<3){return 0;}
        int re=0;
        for(int i=0;i<s.size()-2;i++)
        {
            if(check(s,i)){//cout<<s[i]<<s[i+1]<<s[i+2]<<endl;
                re++;}
        }
        return re;
    }
};